package com.example.rwq_test.designParttern.multiThread.WorkerThread;

/**
 * 工人线程的类
 *
 * @author renweiqiang
 * @version 1.0.0
 * @createTime 2022/11/3
 */
public class WorkThread extends Thread {
    private final Channel channel;

    public WorkThread(String name, Channel channel) {
        super(name);
        this.channel = channel;
    }

    public void run() {
        while (true) {
            Request request = channel.takeRequest();
            request.execute();
        }
    }
}
